/*
* ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
* Without permission, no one has the right to obtain, disclose or use this software in any way.
*/

package com.ecarx.notificationx;

import android.app.Notification;
import android.content.ComponentName;
import android.os.Parcel;

public class WidgetNotification extends StatusBarNotification {

    private ComponentName componentName;

    public WidgetNotification() {
    }

    public WidgetNotification(Parcel in) {
        super(in);
        this.componentName = in.readParcelable(ComponentName.class.getClassLoader());
    }

    public WidgetNotification(String pkg, int id, Notification notification, long postTime, ComponentName componentName) {
        super(pkg, id, notification, postTime);
        this.componentName = componentName;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeParcelable(componentName, flags);
    }

    public ComponentName getComponentName() {
        return componentName;
    }

    public static final Creator<WidgetNotification> CREATOR = new Creator<WidgetNotification>() {
        @Override
        public WidgetNotification createFromParcel(Parcel in) {
            return new WidgetNotification(in);
        }

        @Override
        public WidgetNotification[] newArray(int size) {
            return new WidgetNotification[size];
        }
    };

}
